#include<stdio.h>
#include<stdlib.h>
int main()
{
	int n = 0;
	scanf("%d",&n);
	int* arr = (int*)malloc(sizeof(int));
	int i =0;
	for(i=0;i<n;i++)
	{
		scanf("%d",&arr[i]) ;
	}
	int count =0;
	if(arr[0] != arr[1])
	{
		if(2*arr[1] == arr[2])
		{
			arr[0] = arr[1];
		}
		else
		{
			arr[1] = arr[0];
		}
		count++;
	}
	for(i=2;i<n;i++)
	{
		if(arr[i] != arr[i-1] + arr[i-2])
		{
			arr[i] = arr[i-1] + arr[i-2];
			count++;
		}
	}
	printf("%d",count);
	return 0;
	
 } 
